package jmine.tec.extensions.impl.forms.server;

import java.util.Collections;
import java.util.List;

import jmine.tec.services.api.export.EntityExporter;

class MockServiceGeneratingFormHandler extends AbstractServiceGeneratingFormHandler<MockBoletaService> {
    public MockServiceGeneratingFormHandler() {
        super(MockBoletaService.class);
    }

    public List<String> validate(MockBoletaService form) {
        List<String> output;
        if (form.getaString() == null) {
            output = Collections.singletonList("Erro: aString esta nulo");
        } else {
            output = Collections.emptyList();
        }
        return output;
    }

    @Override
    protected EntityExporter<MockBoletaService> getExporter() {
        return new MockServiceEntityExporter();
    }
}